<template>
  <div class="swiper-main">
    <swiper :options="swiperOption">
      <swiper-slide v-for="(item, index) in swiperList" :key="index">
        <img :src="item.imgUrl" alt="" />
      </swiper-slide>
    </swiper>
    <div class="swiper-pagination"></div>
  </div>
</template>

<script>
import "swiper/dist/css/swiper.css";
import { swiper, swiperSlide } from "vue-awesome-swiper";
export default {
  components: {
    swiper,
    swiperSlide,
  },
  data() {
    return {
      swiperOption: {
        //swiper3
        autoplay: {
          delay: 3000,
          disableOnInteraction: false // 当用户滑动图片后继续自动轮播
        },
        speed: 1000,
        loop: true,//开启循环模式

        pagination: {
          el: ".swiper-pagination",
        },
      },
      swiperList: [
        {
          id: 1,
          imgUrl: "./images/swiper1.jpeg",
        },
        {
          id: 2,
          imgUrl: "./images/swiper2.jpeg",
        },
        {
          id: 3,
          imgUrl: "./images/swiper3.jpeg",
        },
      ],
    };
  },
};
</script>

<style lang="scss" scoped>
.swiper-main {
  overflow: hidden;
  position: relative;
  .swiper-pagination {
    width: 375px;
    bottom:.2667rem
  }
}
.swiper-slide {
  // margin-top: 2.3467rem;
  height: 4.9333rem;
  width: 100%;
  img {
    height: 4.9333rem;
    width: 100;
  }
}
// 修改小球颜色
::v-deep .swiper-pagination-bullet-active{
    background-color:#b0352f ;
  }
// 修改小球间距
  ::v-deep .swiper-pagination-bullet{
	margin:0 0.15rem;
}
</style>